package com.ty.day7;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/30 10:54
 */
public class ThreadDemo01 {
    public static void main(String[] args) {
        Mv mv = new Mv();
        Voice voice = new Voice();
        Discuss discuss = new Discuss();
        mv.setName("视频");
        mv.setPriority(1);
        voice.setPriority(5);
        discuss.setPriority(10);

        discuss.start();
        mv.start();
        voice.start();

        Runnable r = () -> System.out.println("ccc");
        r.run();
        System.out.println(mv.getName());
        System.out.println(voice.getName());
        System.out.println(discuss.getName());
    }
}
class Discuss extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("评论逛");
        }
    }
}
class Voice extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("听声音");
        }
    }
}
class Mv extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("视频正在播放");
        }
    }
}
